<template>
  <div class="single-form">
    <VolForm ref="myform" :formFields="formFields" :formRules="formRules">
      <div style="text-align: center; margin-top: 10px">
        <!-- <el-button type="primary" size="small" @click="getForm"
          >保存</el-button
        > -->
        <!-- <el-button type="success" size="small" @click="reset"
          >重置表单</el-button
        > -->
      </div>
    </VolForm>
  </div>
</template>
<script>
let $vue;
import VolForm from "@/components/basic/VolForm.vue";
import { readonly } from "@vue/reactivity";
export default {
  components: { VolForm },
  created() {
    $vue = this;
	//console.log('oko');
	// console.log("dfd");
  },
  onActivated(){
	  
  },
  OnInit(){
	  
	  /* this.editFormOptions.forEach(x => {
	                  x.forEach(item => {
	                      if (item.field == 'remark') {
	                          console.log(item.field);
	                      }
	                  })
	    }) */
  },
  mounted(){
	 /* this.$refs.myform.editFormOptions.forEach(x => {
	                 x.forEach(item => {
	                     if (item.field == 'remark') {
	                         console.log(item.field);
	                     }
	                 })
	   }) */
  },
  methods: {
    getForm() {
	    console.log(this.formFields);
		//console.log(this.$store.getters.data().curr_reimfloat_remark);//获取当前意见
      if (!this.$refs.myform.validate()) {
        return;
      }
      //this.$message.error(JSON.stringify(this.formFields));
	  this.http.post("/api/Fk_reim/update_curr_reimfloat",this.formFields, true).then((result) => {
	  	  	//console.log(result);
		  this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.reimfloat1.$refs.grid.refresh();//找到上一层的兄弟控件刷新，查询新数据
	  	  if (!result.status){
	  	  	return this.$message.error(result.message)
	  	  }else{
	  	  	this.$Message.info(result.message);
	  	  }
	  	 }); 
	  this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.reimfloat1.$refs.grid.refresh();//找到上一层的兄弟控件刷新，查询新数据
    },
    reset() {
      //重置表单，重置时可指定重置的值，如果没有指定重置的值，默认全部清空
      let data = { remark: "",Variety:""};
      this.$refs.myform.reset(data);
      this.$message.error("表单已重置");
    },
  },
  data() {
	//console.log(this.$store.getters.data().curr_reimfloat_remark);
    return {
      loadKey: true,
      index: 1,
      required: false,
      formFields: {
		fk_reimfloat_id:"",
        //Variety: "",
        remark:"",// this.$store.getters.data().curr_reimfloat_remark,
      },
      formRules: [
		[
		  {
		    title: "序号",
		    required: true,
		    field: "fk_reimfloat_id",
		    type: "string",
			disabled:true,
			hidden:false,
		  },
		 ],
   //       [
   //        {
   //          title: "自动绑定",
   //          //如果这里绑定了data数据，后台不会加载此数据源
   //          /* data: [
   //            { key: "同意", value: "同意" },
   //            { key: "不同意", value: "不同意" },
   //          ], */
   //          //required: true,
   //          field: "Variety",
   //          //dataKey: "pz",
   //          //data: [],
   //          type: "file",
			// url: "/api/Fk_reimfloat/Upload",
   //        },
   //      ], 
        [
          {
            title: "意见",
            required: true,
            field: "remark",
            type: "editor",
			height:110,
          },
        ],
         
      ],
    };
  },
};
</script>
<style scoped>
.single-form {
  position: relative;
  max-width: 1200px;
  padding: 30px 45px;
  left: 0;
   display: flex;
  margin: auto;
}
</style>